package engine.dataobjects;

import java.io.Serializable;


public class MailItem<T>  implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	protected String id;
    protected String name;
    protected String url;
    protected String parser;
    protected String xsltFile;
    protected int maximumWidthImage;
    protected T dataObject;
    
	public T getDataObject() {
		return dataObject;
	}
	public void setDataObject(T dataObject) {
		this.dataObject = dataObject;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getParser() {
		return parser;
	}
	public void setParser(String parser) {
		this.parser = parser;
	}
	public String getXsltFile() {
		return xsltFile;
	}
	public void setXsltFile(String xsltFile) {
		this.xsltFile = xsltFile;
	}
	public int getMaximumWidthImage() {
		return maximumWidthImage;
	}
	public void setMaximumWidthImage(int maximumWidthImage) {
		this.maximumWidthImage = maximumWidthImage;
	}
	

	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + maximumWidthImage;
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result + ((parser == null) ? 0 : parser.hashCode());
		result = prime * result + ((url == null) ? 0 : url.hashCode());
		result = prime * result
				+ ((xsltFile == null) ? 0 : xsltFile.hashCode());
		return result;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		MailItem<T> other = (MailItem) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (maximumWidthImage != other.maximumWidthImage)
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (parser == null) {
			if (other.parser != null)
				return false;
		} else if (!parser.equals(other.parser))
			return false;
		if (url == null) {
			if (other.url != null)
				return false;
		} else if (!url.equals(other.url))
			return false;
		if (xsltFile == null) {
			if (other.xsltFile != null)
				return false;
		} else if (!xsltFile.equals(other.xsltFile))
			return false;
		return true;
	}
	@Override
	public String toString() {
		return "MailItem [id=" + id + ", name=" + name + ", url=" + url
				+ ", parser=" + parser + ", xsltFile=" + xsltFile
				+ ", maximumWidthImage=" + maximumWidthImage + "]";
	}

}
